package dataStorage;

import java.util.Hashtable;

//@author U096819H
public class DataDirectory {

	private String pathname;
	private String filename;
	private Hashtable<String, String> fileHash;

	// @author U096819H
	public DataDirectory() {
		fileHash = new Hashtable<String, String>();
		fileHash.put("expense", "expense.xml");
		fileHash.put("income", "income.xml");
		fileHash.put("category", "category.xml");
		fileHash.put("goal", "goal.xml");
		fileHash.put("source", "source.xml");
		fileHash.put("settings", "settings.xml");
		fileHash.put("idObject", "id.xml");
		setPathname("dataFiles");
	}

	// @author U096819H
	public void setPathname(String pathname) {
		this.pathname = pathname;
	}

	// @author U096819H
	public String getPathname() {
		return this.pathname;
	}

	// @author U096819H
	public String getFilename(String key) {
		filename = this.fileHash.get(key).toString();
		setFilename(filename);
		return filename;
	}

	// @author U096819H
	public void setFilename(String filename) {
		this.filename = filename;
	}

	// @author U096819H
	public void updateEntryFileHash(String key, String value) {
		this.fileHash.put(key, value);
	}

	// @author U096819H
	public void removeEntryFileHash(String key) {
		this.fileHash.remove(key);
	}
}
